package com.first.core.service;

import java.io.Serializable;
import java.util.List;

import com.first.core.common.QueryFilter;
import com.first.core.util.Page;
import com.first.core.util.PageUtil;
import com.first.core.util.PagingBean;

public abstract interface GenericService<T, PK extends Serializable> {
	
	//------------------------- hibernate 相关接口
	
	public abstract T save(T paramT);

	public abstract T merge(T paramT);

	public abstract void evict(T paramT);

	public abstract T get(String paramPK);

	public abstract List<T> getAll();

	public abstract List<T> getAll(PagingBean paramPagingBean);

	public abstract List<T> getAll(QueryFilter paramQueryFilter);

	public abstract void remove(String paramPK);

	public abstract void remove(T paramT);

	public abstract void flush();

	public abstract void execHql(String hql, Object[] obj);
	
	//------------------------- hibernate 相关接口  END.

	
	//------------------------- ibatis 相关接口
	
	public abstract List<T> ibGetAll();

	public abstract T ibGet(PK paramPK);

	public abstract boolean ibExists(PK paramPK);

	public abstract T ibSave(T paramT);

	public abstract void ibRemove(PK paramPK);

	public abstract PageUtil<T> ibFindQueryPage(Object paramObject,
			int paramInt1, int paramInt2);

	public abstract List<T> ibFindQueryPage(String paramString1,
			String paramString2, Object paramObject, Page paramPage);
	
	//------------------------- ibatis 相关接口  END.
}
